import 'package:wechat_assets_picker/wechat_assets_picker.dart';

class CustomSortPathDelegate extends SortPathDelegate {
  CustomSortPathDelegate();

  Map<String, String> map = {
    'Screenshots': '截屏',
    'Camera': '相机',
    'Download': '下载',
  };

  @override
  void sort(List<AssetPathEntity> list) {
    for (final AssetPathEntity entity in list) {
      if (entity.isAll) {
        entity.name = '最近';
      } else if (map.containsKey(entity.name)) {
        entity.name = map[entity.name]!;
      }
    }
  }
}
